package acciones;

import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import dominio.Persona;

public class ComprobarSesion extends ActionSupport implements SessionAware{

	private static final long serialVersionUID = 1L;

	protected Persona checkSesion(String objeto){
		Persona p = (Persona) ActionContext.getContext().getSession().get(objeto);
		return p;
	}
	
	protected void cambiarObjeto(String objeto, Persona p){
		ActionContext.getContext().getSession().remove(objeto);
		ActionContext.getContext().getSession().put(objeto, p);
	}
	
	protected void crearSesion(String objeto, Persona p){
		ActionContext.getContext().getSession().put(objeto, p);
	}

	@Override
	public void setSession(Map<String, Object> arg0) {
		// TODO Auto-generated method stub
		
	}

}
